package pri.damai.xiaowu.common.core.tree.node;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.List;

/**
 * 普通树型结构
 *
 * @author YangXinFu
 * @description
 * @date 9:15 2022/6/7
 **/
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class TreeNode<T extends BaseTreeNode<?>> implements BaseTreeNode<T> {

    private Long id;
    private Long parentId;
    private List<T> children;

    @Override
    public Long getId() {
        return this.id;
    }

    @Override
    public List<T> getChildren() {
        return this.children;
    }

    @Override
    public void setChildren(List<T> children) {
        this.children = children;
    }

    @Override
    public Long getParentId() {
        return this.parentId;
    }
}
